import type { BannerItem, CategoryItem, HotItem, GuessItem, } from '@/types/home'
import type { PageResult, paramsType } from '@/types/global'
import { http } from '@/utils/request'

//获取首页-广告区域-小程序
export const getHomeBannerAPI = (distributionSite = 1) => {
    return http<BannerItem[]>({
        url: '/home/banner',
        method: 'GET',
        data: {
            distributionSite,
        }
    })
}

// 首页-前台分类-小程序
export const getHomeCategoryAPI = () => {
    return http<CategoryItem[]>({
        url: '/home/category/mutli',
        method: 'GET',
    })
}

//首页-热门推荐-小程序
export const getHomeHotAPI = () => {
    return http<HotItem[]>({
        url: '/home/hot/mutli',
        method: 'GET',
    })
}

//首页-猜你喜欢-小程序
export const getGuessLikeAPI = (data?: paramsType) => {
    return http<PageResult<GuessItem>>({
        url: '/home/goods/guessLike',
        method: 'GET',
        data,
    })
}
